<?PHP

 function sqlite_table_exists(&$db, $table) {
  $result = sqlite_query($db, 'SELECT name FROM sqlite_master WHERE type=\'table\' AND name=\''.$table.'\'');
  return count(sqlite_fetch_all($result)) > 0;
 }

 function s($sql) {
  return sqlite_escape_string($sql);
 }

?>
